package com.rr.controller;

import cn.dev33.satoken.annotation.SaCheckRole;
import com.rr.entity.Role;
import com.rr.service.RoleService;
import com.rr.utils.core.TableDataInfo;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping ("role")
public class RoleController extends  BaseController{
    @Resource
    private RoleService roleService;

    /**
     * 获取权限list
     * @param role
     * @return
     */
    @GetMapping("getRoles")
    public TableDataInfo getRoles(Role role) {
        startPage();
        List<Role> query = roleService.query(role);
        return getDataTable(query);
    }


}
